#导包
import unittest
import time
from scripts.test01_login import TestLogin
from scripts.test02_login_success import TestLogin_success
from scripts.test03_employee import TestEmployee
import config
from tools.HTMLTestRunner import HTMLTestRunner

#封装测试套件
suite=unittest.TestSuite()
#登陆接口测试用例
suite.addTest(unittest.makeSuite(TestLogin))
#员工管理场景测试用例
suite.addTest(TestLogin_success("test_login_success"))
#指定report地址
report_url=config.BASE_PROJECT+"/reports/report-{}.html".format(time.strftime("%Y%m%d-%H%M%S"))
#打开文件流
with open(file=report_url,mode="wb") as f:
    #创建HTMLTestRunner运行器
    runner=HTMLTestRunner(f,title="API Report")
    # 执行测试套件
    runner.run(suite)

